<?php $this->load->module('index/index/login_register_header');?>
    <style>
        span.errormsg{display:inline-block;color:#b3b3b3;font-size:14px;text-indent: 20px !important;background: url('<?php echo URLPRE;?>static/template/<?php echo TEMPLATE_NAME?>/images/icons/icon_error.png') no-repeat left;margin: 5px 0 0 -11px;background-repeat: no-repeat;}
        span[for="js-mobile-input"]:empty{display:none !important;}
        span[for="Form[register_code]"]:empty{display:none !important;}
        span[for="password"]:empty{display:none !important;}
        span[for="re-password1"]:empty{display:none !important;}
    </style>
    <script>
        $(function(){
            $('#js-sendCode').click(function(){

                if($('#js-mobile-input').hasClass('valid')){
                    var account = $('input[name="Form[mobile]"]').val();
                }

                if(account!==undefined){
                    var verifyUrl = '<?php echo site_url('member/index/send_register_code');?>' ;
                    $.post(verifyUrl,{
                        account:account
                    },function(data){
                        var json = eval("("+data+")");
                        if(json['status'])
                        {
                            time();
                        }else{
                            alert('短信发送失败！');
                        }
                    })
                }


            });
        })
        var wait=60;
        function time() {
            var o = $('#js-sendCode');
            if (wait == 0) {
                o.removeAttr("disabled");
                o.val("点击获取");
                wait = 60;
            } else {

                o.attr("disabled", true);
                o.val("重新发送(" + wait + ")");
                wait--;
                setTimeout(function() {
                        time()
                    },
                    1000)
            }
        }

    </script>
<div class="register1-header">
    <div class="register1-header-logo"><a href="<?php echo site_url('citysite/index');?>"><img src="<?php echo $sitelogo ;?>" onerror="this.error=null;this.src='<?php echo URLPRE;?>static/public/images/nologo.jpg'" height="57" width="173" /></a></div>
    <div class="register1-header-logo1"><img src="<?php echo URLPRE;?>static/template/<?php echo TEMPLATE_NAME?>/images/retrieve-password-7.png" ></div>
</div>
    <div class="register1-main">
        <div class="register1-modal-content2">
            <div class="register1-register-header text-center">
                <h3>找回密码</h3>
            </div>
            <div class="register1-register-body">
                <form method="post" class="formvalidate form-horizontal" action="<?php echo $form_url;?>">
                    <div class="form-group">
                        <div class="col-md-11 col-md-offset-1">
                            <label for="" class="col-md-3 control-label register1-TZW-register"><span>*</span>手机号码:</label>
                            <div class="col-md-4">
                                <input type="text" class="form-control register1-form-control-register"  id="js-mobile-input" name="Form[mobile]" validate="{required:true,isMobile:true,remote:'<?php echo $mobile_verify;?>',messages:{isMobile:'请输入正确的手机号'}}" placeholder="请输入您的手机号">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-11 col-md-offset-1">
                            <label for="" class="col-md-3 control-label register1-TZW-register"><span>*</span>校验码:</label>
                            <div class="col-md-4">
                                <input type="text" class="form-control register1-form-control-register"  placeholder="请输入校验码" name="Form[register_code]" maxlength="6"  validate="{required:true,number:true,minlength:6,messages:{minlength:'请输入正确的6位验证码'}}">
                            </div>
                            <div class="col-md-4 register1-TZW-cell-phone">
                                <input class="btn btn-default" type="button" id="js-sendCode" value="点击获取">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-11 col-md-offset-1">
                            <label for="password" class="col-md-3 control-label register1-TZW-register"><span>*</span>重置密码:</label>
                            <div class="col-md-4">
                                <input type="password" class="form-control register1-form-control-register" id="password"  name="Form[password]"  onkeyup="pwStrength(this.value)" onblur="pwStrength(this.value)" placeholder="请输入重置密码" validate="{required:true,rangelength:[6,20],messages:{rangelength:'请输入正确的重置密码（密码长度最少6位以上）'}}">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-4 col-md-offset-4 text-center" >
                            <span class="col-md-3 retrieve-password-strength-span" id="strength_L">弱</span>
                            <span class="col-md-3 retrieve-password-strength-span" id="strength_M">中</span>
                            <span class="col-md-3 retrieve-password-strength-span" id="strength_H">强</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-11 col-md-offset-1">
                            <label for="" class="col-md-3 control-label register1-TZW-register"><span>*</span>确认重置密码:</label>
                            <div class="col-md-4">
                                <input type="password" class="form-control register1-form-control-register" id="re-password1" placeholder="请重复输入密码" name="Form[passwordconf]" validate="{required:true,rangelength:[6,20],equalTo:'#password',messages:{rangelength:'请重复输入正确的确认密码',equalTo:'两次输入的密码要一致'}}">
                            </div>
                        </div>
                    </div>
                    <div class="register1-footer-register">
                        <button type="submit" class="btn btn-warning register1-btn-warning-xz register1-btn-warning-xz-register register">立即找回</button>
                    </div>
                </form>
            </div>

        </div>
    </div>
    <script language=javascript>
        //判断输入密码的类型
        function CharMode(iN){
            if (iN>=48 && iN <=57) //数字
                return 1;
            if (iN>=65 && iN <=90) //大写
                return 2;
            if (iN>=97 && iN <=122) //小写
                return 4;
            else
                return 8;
        }
        //bitTotal函数
        //计算密码模式
        function bitTotal(num){
            modes=0;
            for (i=0;i<4;i++){
                if (num & 1) modes++;
                num>>>=1;
            }
            return modes;
        }
        //返回强度级别
        function checkStrong(sPW){
            if (sPW.length<=4)
                return 0; //密码太短
            Modes=0;
            for (i=0;i<sPW.length;i++){
//密码模式
                Modes|=CharMode(sPW.charCodeAt(i));
            }
            return bitTotal(Modes);
        }

        //显示颜色
        function pwStrength(pwd){
            O_color="#cccccc";
            L_color="#f15a24";
            M_color="#fbb13a";
            H_color="#38b54a";
            if (pwd==null||pwd==''){
                Lcolor=Mcolor=Hcolor=O_color;
            }
            else{
                S_level=checkStrong(pwd);
                switch(S_level) {
                    case 0:
                        Lcolor=Mcolor=Hcolor=O_color;
                    case 1:
                        Lcolor=L_color;
                        Mcolor=Hcolor=O_color;
                        break;
                    case 2:
                        Lcolor=L_color;
                        Mcolor=M_color;
                        Hcolor=O_color;
                        break;
                    default:
                        Lcolor=L_color;
                        Mcolor=M_color;
                        Hcolor=H_color;

                }
            }
            document.getElementById("strength_L").style.background=Lcolor;
            document.getElementById("strength_M").style.background=Mcolor;
            document.getElementById("strength_H").style.background=Hcolor;
            return;
        }
    </script>
<?php $this->load->module('index/index/login_register_footer');?>